//
//  MessageListView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/6.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "MessageListView.h"
#import <Masonry.h>
@implementation MessageListView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    
    self.topView = [[UIView alloc] init];
    self.topView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.topView];
    [self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(54);
        make.top.mas_equalTo(0);
    }];
    
    
    self.messageBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.messageBtn setTitle:@"消息通知" forState:(UIControlStateNormal)];
    [self.messageBtn setTitleColor:[UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.messageBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
    [self.topView addSubview:self.messageBtn];
    [self.messageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(80);
        make.top.mas_equalTo(10);
    }];
    
    self.profitBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.profitBtn setTitle:@"分润通知" forState:(UIControlStateNormal)];
    [self.profitBtn setTitleColor:[UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.profitBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
    [self.topView addSubview:self.profitBtn];
    [self.profitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-80);
        make.top.mas_equalTo(10);
    }];
    
    self.messageImv = [[UIImageView alloc] init];
    self.messageImv.image = [UIImage imageNamed:@"icon_line"];
    [self.topView addSubview:self.messageImv];
    [self.messageImv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.topView.mas_bottom).offset(-1);
        make.centerX.equalTo(self.messageBtn);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(3);
    }];
    

    
    self.profitImv = [[UIImageView alloc] init];
    self.profitImv.image = [UIImage imageNamed:@"icon_line"];
    [self.topView addSubview:self.profitImv];
    [self.profitImv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.topView.mas_bottom).offset(-1);
        make.centerX.equalTo(self.profitBtn);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(3);
    }];
    
    
    self.lineView = [[UIView alloc] init];
    self.lineView.backgroundColor = ETTableViewLineColor;
    [self.topView addSubview:self.lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.profitImv.mas_bottom);
        make.height.mas_equalTo(ETTableViewLineHeight);
    }];

    
}

@end
